//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//// PARTICULAR PURPOSE.
////
//// Copyright (c) Microsoft Corporation. All rights reserved

#pragma once

#include <wrl.h>
#include <d3d11_1.h>
#include <d2d1_1.h>
#include <d2d1effects.h>
#include <dwrite_1.h>
#include <wincodec.h>
#include <agile.h>
#include <DirectXMath.h>
#include <box2d\Box2D.h>
#include <tinyxml2\tinyxml2.h>


#include "BasicMath.h"
#include "BasicLoader.h"

//manager
#include "InputManager.h"
#include "ActionManager.h"
#include "RobotManager.h"

//render
#include "DirectX2DRender.h"
#include "BasicCamera.h"
#include "RenderObject.h"
#include "RenderDeclaration.h"
#include "RenderObjectManager.h"

//box2d
#include "Box2DManager.h"
//#include "Box2DDebugDraw.h"

//state
#include "StateMachine.h"
#include "StateMainGame.h"
#include "StateBuilding.h"
//game object
#include "GameScene.h"
#include "BuildingScene.h"

#include "Ground.h"
#include "Robot.h"
#include "RobotPart.h"
#include "RobotBuilder.h"



extern unsigned int key_counter;

inline unsigned int GenerateKey()
{
	return ++key_counter;
}

inline b2Vec2 CovertSizeR2B(float2 size)
{
	return b2Vec2(size.x / 2, size.y / 2);
}

inline float2 CovertSizeB2R(b2Vec2 size)
{
	return float2(size.x * 2, size.y * 2);
}


#define SAFE_DELETE(p) { if(p) { delete (p); (p) = NULL; }}

extern const char* XML_ROBOT;
extern const char* XML_OBJECT_TYPE;
extern const char* XML_PART;
extern const char* XML_PART_TYPE;
extern const char* XML_PART_POSITION_X;
extern const char* XML_PART_POSITION_Y;
extern const char* XML_PART_ROTATION;
extern const char* XML_PART_ID;
extern const char* XML_JOINT_ID_A;
extern const char* XML_JOINT_ID_B;
